Skip to content

Conversation

@ArielElp
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

This was referenced Jan 12, 2026
@ArielElp ArielElp force-pushed the ariel/fix_db_key_separator branch from 2bf9147 to 56f611e Compare January 14, 2026 13:32
Copy link
Contributor Author

@ArielElp ArielElp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArielElp made 3 comments.
Reviewable status: 7 of 12 files reviewed, 3 unresolved discussions (waiting on @nimrod-starkware and @yoavGrs).


crates/starknet_committer/src/db/facts_db/types.rs line 56 at r3 (raw file):

Previously, yoavGrs wrote…

And maybe fn create_facts_db_key as well.

Done. (the constants, not separate function)


crates/starknet_committer/src/patricia_merkle_tree/leaf/leaf_serde.rs line 55 at r3 (raw file):

Previously, yoavGrs wrote…

Index layer wraps StarknetStorageValue and ignores this method.

Maybe the right thing was to define

pub struct FactLayoutStarknetStorageValue(pub StarknetStorageValue);

If you agree, please add TODO for it.

I don't follow, we want this method ignored, we have a separate DBObject implementation.

Unrelated to this PR, it may have made things slightly more clear if we separate the "base" leaf types from the facts layout db types (who happen to be the same), but not worth it IMO.


crates/starknet_patricia_storage/src/db_object.rs line 52 at r3 (raw file):

Previously, yoavGrs wrote…

Define a constant NoDbSeparator = b"".

Done. (different name)

Copy link
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoavGrs reviewed 5 files and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArielElp).


crates/starknet_committer/src/patricia_merkle_tree/leaf/leaf_serde.rs line 55 at r3 (raw file):

Previously, ArielElp wrote…

I don't follow, we want this method ignored, we have a separate DBObject implementation.

Unrelated to this PR, it may have made things slightly more clear if we separate the "base" leaf types from the facts layout db types (who happen to be the same), but not worth it IMO.

I suggested creating a base leaf.
Anyway, that's not going to happen anytime soon.

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 12 files and all commit messages, and made 4 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ArielElp and @yoavGrs).


crates/starknet_committer/src/patricia_merkle_tree/leaf/leaf_serde.rs line 55 at r3 (raw file):

Previously, yoavGrs wrote…

I suggested creating a base leaf.
Anyway, that's not going to happen anytime soon.

index layout wraps leaves, but facts layout uses the "base" leaves?
i.e. index layout wraps fact-y leaves and changes behavior?
a bit confusing, no?
suggestion (not in this PR!):

  1. the DBObject get_db_key trait function definition should include a separator argument
  2. seems like it can have a default implementation after (1), right? no need to impl 3 times here
  3. separator should be defined per layout (const method? associated const, if such a thing exists?)

crates/starknet_patricia_storage/src/db_object.rs line 52 at r3 (raw file):

Previously, ArielElp wrote…

Done. (different name)

why do you have a specific implementation (implementation that doesn't fit all trait implementors) on the trait itself?
I would remove the default impl here, and reinstate it once the separator is a trait-associated-value (or something equivalent) of DBObject trait


crates/starknet_patricia/src/patricia_merkle_tree/traversal_test.rs line 52 at r5 (raw file):

    ) -> DbKey {
        // Dummy key for testing purposes (we only need a key when interacting with storage).
        DbKey(TEST_PREFIX.to_vec())

no longer equivalent, right? previously the DBKey had an extra ":"
doesn't matter though, better this way

Code quote:

DbKey(TEST_PREFIX.to_vec())

crates/starknet_committer/src/db/index_db/types.rs line 184 at r5 (raw file):

        let prefix = L::get_static_prefix(key_context);
        let suffix = self.root_index.0.to_be_bytes();
        create_db_key(prefix, &[], &suffix)
  1. make it explicit
  2. we may want to change this in the future, so no hard-coded literals
const INDEX_DB_KEY_SEPARATOR: &[u8] = b"";

Suggestion:

create_db_key(prefix, INDEX_DB_KEY_SEPARATOR, &suffix)

@ArielElp ArielElp force-pushed the ariel/fix_db_key_separator branch from 56f611e to 957557e Compare January 15, 2026 14:12
@ArielElp ArielElp force-pushed the ariel/remove_filled_node_impl branch from 9c7d4a5 to 578fe88 Compare January 15, 2026 14:12
@ArielElp ArielElp force-pushed the ariel/fix_db_key_separator branch from 957557e to 73f2def Compare January 15, 2026 16:02
@ArielElp ArielElp force-pushed the ariel/remove_filled_node_impl branch from 578fe88 to 22e313f Compare January 15, 2026 16:02
Copy link
Contributor Author

@ArielElp ArielElp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ArielElp made 3 comments.
Reviewable status: 1 of 12 files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware, @nimrod-starkware, and @yoavGrs).


crates/starknet_committer/src/db/index_db/types.rs line 184 at r5 (raw file):

Previously, dorimedini-starkware wrote…
  1. make it explicit
  2. we may want to change this in the future, so no hard-coded literals
const INDEX_DB_KEY_SEPARATOR: &[u8] = b"";

Done (there's already EMPTY_DB_KEY_SEPARATOR, made it pub)


crates/starknet_committer/src/patricia_merkle_tree/leaf/leaf_serde.rs line 55 at r3 (raw file):

Previously, dorimedini-starkware wrote…

index layout wraps leaves, but facts layout uses the "base" leaves?
i.e. index layout wraps fact-y leaves and changes behavior?
a bit confusing, no?
suggestion (not in this PR!):

  1. the DBObject get_db_key trait function definition should include a separator argument
  2. seems like it can have a default implementation after (1), right? no need to impl 3 times here
  3. separator should be defined per layout (const method? associated const, if such a thing exists?)

Agree on it being a bit confusing. We can have separate wrappers at the end of the stack, though it's unrelated to the question ATM.

Re 1-3, an associated const on DBObject itself seems like the way to go. DBObject impl is clearly layout-dependent, and that way we don't worry about propogating it from e.g. Layout all the way to create_db_key.

TLDR of the changes now:

  1. Still two arguments
  2. We do have a default impl now that fits everyone
  3. Associated const on DBObject

crates/starknet_patricia_storage/src/db_object.rs line 52 at r3 (raw file):

Previously, dorimedini-starkware wrote…

why do you have a specific implementation (implementation that doesn't fit all trait implementors) on the trait itself?
I would remove the default impl here, and reinstate it once the separator is a trait-associated-value (or something equivalent) of DBObject trait

Irrelevant given the discussion above.

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 11 files and all commit messages, made 1 comment, and resolved 3 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp).


crates/starknet_committer/src/db/index_db/types.rs line 187 at r6 (raw file):

        let prefix = L::get_static_prefix(key_context);
        let suffix = self.root_index.0.to_be_bytes();
        create_db_key(prefix, INDEX_LAYOUT_DB_KEY_SEPARATOR, &suffix)

maybe this is better... separator should really be part of DBObjects only, WDYT?

Suggestion:

IndexFilledNode::<L>::DB_KEY_SEPARATOR

@ArielElp ArielElp force-pushed the ariel/remove_filled_node_impl branch from 22e313f to af82457 Compare January 18, 2026 08:43
@ArielElp ArielElp force-pushed the ariel/fix_db_key_separator branch from 73f2def to 93bad1e Compare January 18, 2026 08:43
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp).

@ArielElp ArielElp force-pushed the ariel/remove_filled_node_impl branch from af82457 to 7d1c88f Compare January 18, 2026 09:56
@ArielElp ArielElp force-pushed the ariel/fix_db_key_separator branch from 93bad1e to 7427ed8 Compare January 18, 2026 09:56
@ArielElp ArielElp force-pushed the ariel/remove_filled_node_impl branch from 7d1c88f to fe78bbd Compare January 18, 2026 11:13
@ArielElp ArielElp force-pushed the ariel/fix_db_key_separator branch from 7427ed8 to 67c930b Compare January 18, 2026 11:13
@ArielElp ArielElp changed the base branch from ariel/remove_filled_node_impl to graphite-base/11641 January 18, 2026 11:54
@ArielElp ArielElp force-pushed the ariel/fix_db_key_separator branch from 67c930b to e25225d Compare January 18, 2026 11:54
@ArielElp ArielElp force-pushed the graphite-base/11641 branch from fe78bbd to cd38a3a Compare January 18, 2026 11:54
@ArielElp ArielElp changed the base branch from graphite-base/11641 to main-v0.14.1-committer January 18, 2026 11:54
@ArielElp ArielElp force-pushed the ariel/fix_db_key_separator branch from e25225d to 2f9e569 Compare January 18, 2026 12:13
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 2 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp).

@ArielElp ArielElp force-pushed the ariel/fix_db_key_separator branch from 2f9e569 to 4e2cfa8 Compare January 18, 2026 17:32
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dorimedini-starkware reviewed 2 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp).

@ArielElp ArielElp added this pull request to the merge queue Jan 19, 2026
Merged via the queue into main-v0.14.1-committer with commit ec69868 Jan 19, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants